package com.itheima.method;

/**
 * @author jiangxun
 * @date 11-13-2024
 */
public class MethodDemo2 {
    public static void main(String[] args) {
        // 目标：认识方法重载
        fire(10, 20);
        fire(10.0, 20.0, "地球");

    }

    /**
     * 需求：发射导弹
     */
    public static void fire(int x, int y) {
        System.out.println("发射导弹，坐标：" + x + "," + y);
    }

    // 定义一个重载方法
    public static void fire(double x, double y, String location) {
        System.out.println("发射导弹，坐标：" + x + "," + y + "，位置：" + location);
    }
}
